﻿<!--#include file="../../../Inc/Const.Asp"-->
<%
Dim Plus
Set Plus = New Cls_Plus
Plus.Open("comment") ' 打开配置文件
Plus.CheckUser ' 权限检查

Dim ID,Key,Rs,i

On Error Resume Next
Select Case LCase(Request("Act"))
Case "commentstate"
	ID = Request("ID")
	If IsNumeric(ID) And Len(ID) >= 1 Then
		Set Rs = DB("Select [State] From [{pre}Comment] Where [ID]=" & ID,3)
		If Not Rs.Eof Then
			If Rs(0) = 0 Then
				Rs(0) = 1 : Response.Write "True|已审"
			Else
				Rs(0) = 0 : Response.Write "True|<font color=blue>待审</font>"
			End If
			Rs.Update
		Else
			Response.Write "False|评论不存在！"
		End If
		Rs.Close : Set Rs = Nothing
	Else
		Response.Write "False|参数格式不正确！"
	End If
Case "recomment"
	ID = Request("ID")
	If IsNumeric(ID) And Len(ID) >= 1 Then
		Set Rs = DB("Select [ReComment] From [{pre}Comment] Where [ID]=" & ID,1)
		If Not Rs.Eof Then
			Response.Write "True|"
			Response.Write "<table width='99%' border='0' align='center' cellpadding='2' cellspacing='0'>"
			Response.Write "  <tr>"
			Response.Write "    <td><textarea name='oRecomment" & ID & "' rows='3' style='width:99%;' id='oRecomment" & ID & "' class='ajax_input'>" & Server.HTMLENCode(Rs(0) & "") & "</textarea></td>"
			Response.Write "  </tr>"
			Response.Write "  <tr>"
			Response.Write "    <td><input type='submit' value='回复' class='ajax_input' onclick=""ReCommentSave(" & ID & ",oRecomment" & ID & ".value,'Save');"">&nbsp;&nbsp;<input type='submit' class='ajax_input' value='取消' onclick=""ReCommentSave(" & ID & ",'','UnSave');""></td>"
			Response.Write "  </tr>"
			Response.Write "</table>"
		Else
			Response.Write "False|评论不存在！"
		End If
		Rs.Close : Set Rs = Nothing
	Else
		Response.Write "False|参数格式不正确！"
	End If
Case "recommentsave"
	ID = Request("ID")
	Dim Recomment : Recomment = Request("oRecomment")
	If IsNumeric(ID) And Len(ID) >= 1 Then
		Set Rs = DB("Select [ReComment] From [{pre}Comment] Where [ID]=" & ID,3)
		If Not Rs.Eof Then
			If LCase(Request("SaveIT")) = "save" Then Rs(0) = Recomment : Rs.Update
			If Len(Rs(0)) > 0 Then Response.Write "True|<font color=red>回复: " & Rs(0) & "</font>" Else Response.Write "True|"
		Else
			Response.Write "False|评论不存在！"
		End If
		Rs.Close : Set Rs = Nothing
	Else
		Response.Write "False|参数格式不正确！"
	End If
Case Else
	Response.Write "False|未指定的查询操作！"
End Select
If Err Then Response.Write "False|ERR: " & Err.Description
If IsObject(Conn) Then Conn.Close
Set Plus = Nothing
%>